package vip.liux.backend.application.service.shop;

import com.fasterxml.jackson.annotation.JsonInclude;
import jakarta.annotation.Nullable;
import lombok.Data;
import vip.liux.backend.domain.shared.shop.AreaLevel;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

@Data
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class RegionDto implements Serializable {
    private Long id;
    private String code;
    private String name;
    private Long parentId;
    private AreaLevel level;
    private Map<Long, RegionDto> city;
    private Map<Long, RegionDto> region;

    public RegionDto(Long id, String code, String name, @Nullable Long parentId, AreaLevel level) {
        this.id = id;
        this.code = code;
        this.name = name;
        this.parentId = parentId;
        this.level = level;
        this.city = new HashMap<>();
        this.region = new HashMap<>();
    }
}
